package com.qy.fortune.service;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class FortuneService{
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	/**
	 * 生日密码
	 * @param ui
	 * @return
	 */
	public String[] getBirthSec(String month,String day){
		String [] ret = new String[2];
		String sql = "select name,content from birthday where month = ? and day = ?"; 
		Map<String,Object> m = jdbcTemplate.queryForMap(sql, new Object[]{month,day});	
		ret[0] = (String)m.get("name");
		ret[1] = (String)m.get("content");
		return ret;
	}
	
	
}
